<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:motion="http://schemas.android.com/tools">
    <Transition
        app:constraintSetEnd="@+id/end"
        app:constraintSetStart="@+id/start"
        app:autoTransition="none"
        app:duration="1500">
        <OnSwipe
            app:dragDirection="dragUp"
            app:moveWhenScrollAtTop="true"
            app:touchAnchorId="@+id/animeInfoRecyclerView"
            app:touchAnchorSide="top"
            motion:onTouchUp="stop" />
    </Transition>

    <ConstraintSet android:id="@+id/start">

        <Constraint
            android:id="@+id/topView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardElevation="0dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:background="@android:color/white"/>



        <Constraint
            android:id="@+id/animeInfoRoot"

            android:background="@android:color/white"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="30dp"
            android:layout_marginTop="10dp"
            android:layout_marginEnd="20dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/topView"
            app:visibilityMode="ignore"/>

        <Constraint
            android:id="@+id/animeInfoSummary"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="30dp"
            android:layout_marginTop="20dp"
            android:layout_marginEnd="20dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/animeInfoRoot"
            />
        <Constraint android:id="@+id/loading">
            <PropertySet
                app:applyMotionScene="false"
                app:visibilityMode="ignore" />
        </Constraint>


    </ConstraintSet>


    <ConstraintSet android:id="@+id/end"
        motion:deriveConstraintsFrom="@id/start"
        >


        <Constraint
            android:id="@+id/topView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardElevation="2dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:background="@android:color/white">


        </Constraint>

        <Constraint
            android:id="@+id/animeInfoRoot"
            android:layout_width="match_parent"
            app:visibilityMode="ignore"
            android:background="@android:color/white"
            android:layout_height="wrap_content"
            android:layout_marginStart="30dp"
            android:layout_marginTop="10dp"
            android:layout_marginEnd="20dp"
            app:layout_constraintBottom_toBottomOf="@id/topView"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent" />


        <Constraint
            android:id="@+id/animeInfoSummary"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="30dp"
            android:layout_marginTop="20dp"
            android:layout_marginEnd="20dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintBottom_toBottomOf="@id/topView"
            android:background="@drawable/shadow_backgorund"
            />
<!--        <Constraint-->
<!--            android:id="@id/loading"-->
<!--            app:layout_constraintEnd_toEndOf="parent"-->
<!--            app:layout_constraintStart_toStartOf="parent"-->
<!--            app:layout_constraintTop_toTopOf="parent"-->
<!--            app:layout_constraintTop_toBottomOf="parent"-->
<!--            app:visibilityMode="ignore"-->
<!--            />-->


    </ConstraintSet>

</MotionScene>